Public Class MyLicensingProvider
    Inherits System.ComponentModel.LicenseProvider

    Public Overrides Function GetLicense( _
       ByVal context As System.ComponentModel.LicenseContext, _
       ByVal type As System.Type, _
       ByVal instance As Object, _
       ByVal allowExceptions As Boolean) As System.ComponentModel.License

        Dim lic As New SampleLicense

        If lic.LicenseKey = "OK" Then
            Return lic
        Else
            If allowExceptions Then
                Throw New System.ComponentModel.LicenseException(type)
            End If
        End If
        Return Nothing
    End Function

End Class
